package com.yungu.swift.report.controller;

import com.yungu.swift.base.ResponseData;
import com.yungu.swift.base.model.admin.AdminReportParam;
import com.yungu.swift.report.entity.ReportIndexHour;
import com.yungu.swift.report.service.IndexHourService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 首页综合数控制器 今日订单量 + 今日新注册用户量 + 今日总金额
 */
@RestController
@RequestMapping("/report/indexHour")
@Api(value = "【首页统计】", tags = "今日订单量、今日新注册用户量、今日总金额")
public class IndexHourCtrl {

    @Autowired
    private IndexHourService indexHourService;

    @PostMapping("/queryIndex")
    @ApiOperation(value = "首页统计 —— 今日订单量、今日新注册用户量、今日总金额", httpMethod = "POST")
    public ResponseData<List<ReportIndexHour>> queryIndex(@RequestBody AdminReportParam reportParam) {
        return indexHourService.queryIndex(reportParam);
    }
}
